<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv=X-UA-Compatible content="IE=edge,chrome=1">
    <meta content=always name=referrer>
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="__STATIC__/css/base_user.css">
    <script src="__STATIC__/js/jquery-1.8.2.js"></script>
    <title>店铺</title>
    <style>
        #wall_1{
            border-radius: 100%;
            border: 3px solid white;
        }
    </style>
    <style>
        .fileInput{
            width:100%;
            height:100%;
            position:absolute;
            opacity: 0;
            filter:alpha(opacity=0);
            cursor:pointer;
        }
        #wall{
            top: 0%;
            left:5%;
            transform: scale(0.8);
            position: absolute;
            width:100%;
            height:100%;
        }
    </style>

    <script>
        $(document).ready(function () {
//            var wall_1 = document.getElementById('wall_1');
//            wall_1.style.height=wall_1.offsetWidth-6+'px';
//            var wall_0 = document.getElementById('wall_0');
//            wall_0.style.height=wall_0.offsetWidth*0.5+'px';
            //上传logo
            $('#File').change(function () {
                $('#form').ajaxSubmit({
                    url:"{:url('mobile/shop_auth/upload_logo')}",
                    type:'post',
                    dataType:'json',
                    enctype: 'multipart/form-data',
                    success:function(t){
                        if (t.code == 200){
                            layer.open({content:'logo上传成功',skin:'msg',time:2});
                            $('.pic3').prop('src',t.message);
                        }else{
                            layer.open({content:t.message,skin:'msg',time:2});
                        }
                    }
                });
            })
        })
        //收藏和取消店铺
        function collect_shop(shop_id){
            if (!'{$Think.session.member_id}'){jump_login();return false;}
            $.ajax({
                url:"member_collect",
                dataType:'json',
                type:'post',
                data:{'type':2,'id':shop_id},
                success:function(t){
                    if (t.code == 200){  //已收藏
                        $('#NUM').text(parseInt($('#NUM').text())+1);
                        $('#collect').prop('src','__STATIC__/img_user/shop_sc_1.png');
                    }else if(t.code == 100){  //取消收藏
                        $('#NUM').text(parseInt($('#NUM').text())-1);
                        $('#collect').prop('src','__STATIC__/img_user/shop_sc_0.png');
                    }
                    layer.open({content:t.message,skin:'msg',time:2});
                }
            })
        }
    </script>
</head>
<body>
<form action="" id="form" method="post" >
    <div class="wrap-cre">

        <div class="header">
            <p>店铺简介</p>
            <img src="/static/mobile/img_user/back.png" class="back" onclick="history.go(-1)">
        </div>
        <div class="center">
            <div class="info">
                <img src="/{$shopInfo.banner}" class="pic1" id="wall_0" onerror=this.src='/static/mobile/img_user/web_logo.png' style="height:180px;">
                <div class="pic2">
                    <img src="/{$shopInfo.logo}"  class="pic3" id="wall_1" onerror=this.src='/static/mobile/img/empty_img.png' >
                </div>
            </div>
            <div class="name">
                <p><span style="color: white;background: #E73F09;border-radius: 4px;font-size: 12px;line-height: 18px;padding: 0 5px;">{eq name="shopInfo.type" value="个人"}自营{/eq}</span> {$shopInfo.title} </p>
                <p>{$shopInfo.description}</p>
            </div>
            <div class="shoucang">
                <a href="javascript:collect_shop({:input('shop_id')});"><img id="collect" src="__STATIC__/img_user/shop_sc_{$collect_status}.png"></a><br>
                <span><font id="NUM">{$shopInfo.collect_number}</font>人收藏</span>
            </div>
        </div>
</form>
{include file="public/href"/}
<style>

</style>
    <div class="dp-info">
        <ul>
            <li>掌柜名<span>{$shopInfo.name}</span></li>
            <li>服务电话<span>{$shopInfo.phone}</span></li>
            <li>开店时间<span>{:date('Y-m-d H:i:s',$shopInfo.create_time)}</span></li>
        </ul>
    </div>
</div>
{include file="public/src" /}
<script>
    function search_title(){
        var shop_id = $('#shop_id').val(),
                search = $('#search').val();
        window.location.href = "{:url('mobile/user_category/shop_all_goods')}?shop_id="+shop_id+"&search="+search;
    }
</script>
</body>
</html>